<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>n8n 安装指南 - 从零开始构建自动化工作流</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        
        .step-number {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            font-weight: bold;
            flex-shrink: 0;
        }
        
        .code-block {
            background: #1e293b;
            color: #e2e8f0;
            border-radius: 8px;
            padding: 1rem;
            overflow-x: auto;
            font-family: 'Consolas', 'Monaco', monospace;
            position: relative;
        }
        
        .code-block::before {
            content: attr(data-lang);
            position: absolute;
            top: 0;
            right: 0;
            background: #475569;
            color: #e2e8f0;
            padding: 0.25rem 0.75rem;
            border-radius: 0 8px 0 8px;
            font-size: 0.75rem;
            text-transform: uppercase;
        }
        
        .feature-icon {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .section-divider {
            height: 2px;
            background: linear-gradient(to right, transparent, #e5e7eb, transparent);
            margin: 3rem 0;
        }
        
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.25rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        .highlight-box {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border-left: 4px solid #f59e0b;
            padding: 1rem 1.5rem;
            border-radius: 0.5rem;
            margin: 1.5rem 0;
        }
        
        .nav-item {
            position: relative;
            overflow: hidden;
        }
        
        .nav-item::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 0;
            height: 2px;
            background: #667eea;
            transition: width 0.3s ease;
        }
        
        .nav-item:hover::after {
            width: 100%;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6">
            <div class="text-center">
                <h1 class="text-5xl md:text-6xl font-bold mb-6">
                    <i class="fas fa-robot mr-4"></i>n8n 安装指南
                </h1>
                <p class="text-xl md:text-2xl mb-8 opacity-90">从零开始构建你的自动化工作流平台</p>
                <div class="flex justify-center space-x-6">
                    <div class="text-center">
                        <i class="fas fa-cloud text-4xl mb-2"></i>
                        <p class="text-sm">云端部署</p>
                    </div>
                    <div class="text-center">
                        <i class="fas fa-server text-4xl mb-2"></i>
                        <p class="text-sm">自托管</p>
                    </div>
                    <div class="text-center">
                        <i class="fas fa-code text-4xl mb-2"></i>
                        <p class="text-sm">开源免费</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Navigation -->
    <nav class="bg-white shadow-lg sticky top-0 z-50">
        <div class="container mx-auto px-6 py-4">
            <div class="flex justify-center space-x-8 text-gray-700">
                <a href="#preparation" class="nav-item hover:text-purple-600 transition">准备工作</a>
                <a href="#cloud" class="nav-item hover:text-purple-600 transition">云端部署</a>
                <a href="#self-hosted" class="nav-item hover:text-purple-600 transition">自托管</a>
                <a href="#npm" class="nav-item hover:text-purple-600 transition">NPM安装</a>
                <a href="#faq" class="nav-item hover:text-purple-600 transition">常见问题</a>
            </div>
        </div>
    </nav>

    <!-- Main Content -->
    <main class="container mx-auto px-6 py-12">
        <!-- 准备工作 -->
        <section id="preparation" class="mb-16">
            <h2 class="text-4xl font-bold mb-8 text-gray-800">
                <i class="fas fa-clipboard-check mr-3 text-purple-600"></i>准备工作
            </h2>
            
            <div class="bg-white rounded-xl shadow-xl p-8 mb-8">
                <p class="text-lg text-gray-700 mb-6">
                    <span class="drop-cap">在</span>开始安装之前，您需要了解 n8n 的两种主要部署方式，选择最适合您需求的方案。
                </p>
                
                <div class="grid md:grid-cols-2 gap-6 mt-8">
                    <div class="card-hover bg-gradient-to-br from-purple-50 to-pink-50 p-6 rounded-lg border border-purple-200">
                        <div class="flex items-start">
                            <i class="fas fa-cloud text-3xl feature-icon mr-4"></i>
                            <div>
                                <h3 class="text-xl font-bold mb-2 text-gray-800">n8n Cloud</h3>
                                <p class="text-gray-600">无需安装，注册即可使用。适合不想管理服务器的用户，提供免费试用和付费计划。</p>
                                <div class="mt-4 space-y-2">
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>零配置，即刻开始</p>
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>自动更新和维护</p>
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>专业技术支持</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="card-hover bg-gradient-to-br from-blue-50 to-cyan-50 p-6 rounded-lg border border-blue-200">
                        <div class="flex items-start">
                            <i class="fas fa-server text-3xl feature-icon mr-4"></i>
                            <div>
                                <h3 class="text-xl font-bold mb-2 text-gray-800">自托管社区版</h3>
                                <p class="text-gray-600">免费开源，需自行部署。适合有技术能力的用户，完全控制数据和配置。</p>
                                <div class="mt-4 space-y-2">
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>完全免费</p>
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>数据完全自主</p>
                                    <p class="text-sm text-gray-500"><i class="fas fa-check text-green-500 mr-2"></i>高度可定制</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- 部署方式对比 -->
            <div class="bg-white rounded-xl shadow-xl p-8">
                <h3 class="text-2xl font-bold mb-6 text-gray-800">部署方式对比</h3>
                <div class="mermaid">
                    graph LR
                        A[选择部署方式] --> B{技术能力}
                        B -->|新手/非技术用户| C[n8n Cloud]
                        B -->|有技术基础| D[自托管]
                        C --> E[注册账号]
                        C --> F[即刻使用]
                        D --> G[Docker部署]
                        D --> H[NPM安装]
                        G --> I[生产环境推荐]
                        H --> J[开发测试环境]
                        
                        style A fill:#667eea,stroke:#fff,color:#fff
                        style C fill:#fbbf24,stroke:#fff,color:#fff
                        style D fill:#10b981,stroke:#fff,color:#fff
                </div>
            </div>
        </section>

        <div class="section-divider"></div>

        <!-- n8n Cloud 安装 -->
        <section id="cloud" class="mb-16">
            <h2 class="text-4xl font-bold mb-8 text-gray-800">
                <i class="fas fa-cloud-upload-alt mr-3 text-purple-600"></i>安装方式一：n8n Cloud
            </h2>
            
            <div class="bg-white rounded-xl shadow-xl p-8">
                <p class="text-lg text-gray-700 mb-8">n8n Cloud 是最简单的使用方式，无需本地安装，适合新手快速上手。</p>
                
                <div class="space-y-6">
                    <!-- Step 1 -->
                    <div class="flex items-start">
                        <div class="step-number">1</div>
                        <div class="ml-6 flex-1">
                            <h4 class="text-xl font-bold mb-3">注册账户</h4>
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <ul class="space-y-2 text-gray-700">
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>访问 <a href="https://n8n.io/" class="text-purple-600 hover:underline">n8n 官方网站</a> 或直接前往 <a href="https://app.n8n.cloud/" class="text-purple-600 hover:underline">n8n Cloud</a></li>
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>点击"Sign Up"或"Try for Free"注册免费试用账户</li>
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>填写邮箱地址并设置密码，或使用 Google 账户登录</li>
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>注册后，您会收到一封确认邮件，点击链接激活账户</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Step 2 -->
                    <div class="flex items-start">
                        <div class="step-number">2</div>
                        <div class="ml-6 flex-1">
                            <h4 class="text-xl font-bold mb-3">开始使用</h4>
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <ul class="space-y-2 text-gray-700">
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>登录后，您将进入 n8n 的在线工作台</li>
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>无需额外配置，即可开始创建工作流</li>
                                    <li><i class="fas fa-arrow-right text-purple-500 mr-2"></i>免费试用版提供有限的功能和使用配额，足够用于测试和学习</li>
                                </ul>
                            </div>
                        </div>
                    </div>
                    
                    <!-- Step 3 -->
                    <div class="flex items-start">
                        <div class="step-number">3</div>
                        <div class="ml-6 flex-1">
                            <h4 class="text-xl font-bold mb-3">升级计划（可选）</h4>
                            <div